package com.wuyancheng.service.impl;

import com.wuyancheng.dao.ResumeDao;
import com.wuyancheng.pojo.Resume;
import com.wuyancheng.service.IResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class ResumeServiceImpl implements IResumeService {

    @Autowired
    private ResumeDao resumeDao;

    @Override
    public Resume findOneResume(long id) {
        Optional<Resume> byId = resumeDao.findById(id);
        return byId.get();
    }

    @Override
    public List<Resume> findAllResume(){
        return resumeDao.findAll();
    }

    @Override
    public Resume saveResume(Resume resume){
        return resumeDao.save(resume);
    }

    @Override
    public void deleteResume(long id){
        resumeDao.deleteById(id);
    }



}
